import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const ParkingManagementMeta: IPublicTypeComponentMetadata = {
  componentName: 'ParkingManagement',
  title: '停车场管理',
  category: '管理',
  group: '出行服务',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'ParkingManagement',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
    {
      name: 'className',
      propType: 'string',
    },
    {
      name: 'width',
      propType: 'number',
      description: '组件宽度'
    },
    {
      name: 'height',
      propType: 'number',
      description: '组件高度'
    },
    {
      name: 'topLeftImage',
      propType: 'string',
      description: '左上角图片'
    },
    {
      name: 'topRightImage',
      propType: 'string',
      description: '右上角图片'
    },
    {
      name: 'bottomLeftImage',
      propType: 'string',
      description: '左下角图片'
    },
    {
      name: 'bottomRightImage',
      propType: 'string',
      description: '右下角图片'
    },
    {
      name: 'centerImage',
      propType: 'string',
      description: '中心图片'
    },
    {
      name: 'showLabels',
      propType: 'bool',
      description: '显示标签'
    },
    {
      name: 'theme',
      propType: 'string',
      description: '主题'
    },
    {
      name: 'onCornerClick',
      propType: 'func',
      description: '角落点击事件'
    },
    {
      name: 'onCenterClick',
      propType: 'func',
      description: '中心点击事件'
    },
    {
      name: 'onClick',
      propType: 'func',
      description: '点击事件'
    }
  ],
  configure: {
    props: [
      {
        name: 'topLeftImage',
        title: { label: { type: 'i18n', 'en-US': 'topLeftImage', 'zh-CN': '左上角图片' } },
        setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'http://localhost:8085/static/images/chuxingfuwu/bg1.png' }
      },
      {
        name: 'topRightImage',
        title: { label: { type: 'i18n', 'en-US': 'topRightImage', 'zh-CN': '右上角图片' } },
        setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'http://localhost:8085/static/images/chuxingfuwu/bg2.png' }
      },
      {
        name: 'bottomLeftImage',
        title: { label: { type: 'i18n', 'en-US': 'bottomLeftImage', 'zh-CN': '左下角图片' } },
        setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'http://localhost:8085/static/images/chuxingfuwu/bg11.png' }
      },
      {
        name: 'bottomRightImage',
        title: { label: { type: 'i18n', 'en-US': 'bottomRightImage', 'zh-CN': '右下角图片' } },
        setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'http://localhost:8085/static/images/chuxingfuwu/bg12.png' }
      },
      {
        name: 'centerImage',
        title: { label: { type: 'i18n', 'en-US': 'centerImage', 'zh-CN': '中心图片' } },
        setter: { componentName: 'StringSetter', isRequired: false, initialValue: 'http://localhost:8085/static/images/chuxingfuwu/zx.png' }
      },
      {
        name: 'showLabels',
        title: { label: { type: 'i18n', 'en-US': 'showLabels', 'zh-CN': '显示标签' } },
        setter: { componentName: 'BoolSetter', isRequired: false, initialValue: false }
      }
    ],
    supports: {
      style: true
    }
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '停车场管理',
    screenshot: '',
    schema: {
      componentName: 'ParkingManagement',
      props: {
        // width: 439, 容器宽度高度根据cornerSize和centerSize计算
        // height: 124,
        topLeftImage: 'http://localhost:8085/static/images/chuxingfuwu/bg1.png',
        topRightImage: 'http://localhost:8085/static/images/chuxingfuwu/bg2.png',
        bottomLeftImage: 'http://localhost:8085/static/images/chuxingfuwu/bg11.png',
        bottomRightImage: 'http://localhost:8085/static/images/chuxingfuwu/bg12.png',
        centerImage: 'http://localhost:8085/static/images/chuxingfuwu/zx.png',
        cornerSize: {
          width: 173,
          height: 57
        },
        centerSize: {
          width: 151,
          height: 130
        },
        showLabels: false,
        labels: {
          topLeft: '停车区域A',
          topRight: '停车区域B',
          bottomLeft: '停车区域C',
          bottomRight: '停车区域D',
        },
        number: {
          topLeft: '123',
          topRight: '222',
          bottomLeft: '333',
          bottomRight: '444',
        },
        theme: 'dark'
      }
    }
  }
];

export default {
  ...ParkingManagementMeta,
  snippets
};
